package org.yefei.homeworkday14;

public class Animal {
	/*
	 * 3（预习）：定义动物类，有名称，年龄，体重属性，有叫，跑的方法， 定义猫类和八哥类，继承动物类，
	 * 但是叫和跑的方式不一样,猫有抓老鼠的方法，八哥有说话的方法，用oo+结合继承模拟。
	 */
	private String name;
	private int age;
	private double weight;

	public Animal() {
	}

	public Animal(String name, int age, double weight) {
		this.name = name;
		this.age = age;
		this.weight = weight;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public double getWeight() {
		return weight;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}

	public void shout() {
		System.out.println(name + "会叫！");
	}

	public void run() {
		System.out.println(name + "会跑！");
	}

}
